package com.building.service;

import java.util.List;

import com.building.common.R;
import com.building.entity.ShoppingOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.PathVariable;

/**
@author yinjiahui
@create 2021-04-11 17:11
*/
public interface ShoppingOrderService extends IService<ShoppingOrder>{


    int updateBatch(List<ShoppingOrder> list);

    int updateBatchSelective(List<ShoppingOrder> list);

    int batchInsert(List<ShoppingOrder> list);

    int insertOrUpdate(ShoppingOrder record);

    int insertOrUpdateSelective(ShoppingOrder record);

    /**
     * 根据用户id查询订单中的商品
     *
     * @param userId
     * @return
     */
    List<ShoppingOrder> selectShoppingOrderByUserId(Integer userId);

    /**
     * 新增或修改订单
     *
     * @param shoppingOrder
     * @return
     */
    R insertOrUpdateShoppingOrderByShoppingOrderId(ShoppingOrder shoppingOrder);

    /**
     * 根据订单id和用户id删除订单中的商品
     *
     * @param shoppingOrderId
     * @param userId
     * @return
     */
    void deleteShoppingOrderByShoppingOrderIdAndUserId(Integer shoppingOrderId, Integer userId);
}
